package com.bw.lyc.mvp.view.people.adapter;

import android.widget.ImageView;

import com.bw.lyc.R;
import com.bw.lyc.mvp.model.entity.RecommendEntity;
import com.bw.lyc.network.LoadImage;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;


public class RecommendAdapter extends BaseQuickAdapter<RecommendEntity.Values, BaseViewHolder> {

    public RecommendAdapter() {
        super(R.layout.item_video_recommend);
        addChildClickViewIds(R.id.video_recommend_play_img);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, RecommendEntity.Values values) {
        baseViewHolder.setText(R.id.video_recommend_title_tv,values.news_title);
        baseViewHolder.setText(R.id.video_recommend_author_tv,values.news_author);
        baseViewHolder.setText(R.id.video_recommend_time_tv,""+values.news_time);
        ImageView imageView = baseViewHolder.getView(R.id.video_recommend_cover_img);
        LoadImage.loadMatchImg(values.getMedias().get(0).media_url,imageView);
    }
}
